package com.itpeng.service.Impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.itpeng.dao.SetmealMobileDao;
import com.itpeng.pojo.Setmeal;
import com.itpeng.service.SetmealMobileService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Aythor:彭彦钦
 * @Data: 2020/9/24  15:08
 */
@Service(interfaceClass = SetmealMobileService.class)
public class SetmealMobileServiceImpl implements SetmealMobileService {
    @Autowired
    private SetmealMobileDao setmealMobileDao;

    /**
     * 查询所有套餐
     * @return
     */
    @Override
    public List<Setmeal> getSetmeal() {
        return setmealMobileDao.getSetmeal();
    }

    /**
     * 查询套餐详情
     * @param id
     * @return
     */
    @Override
    public Setmeal findDetailById(Integer id) {
        Setmeal setmeal = setmealMobileDao.findBySetmealId(id);
        return setmeal;
    }

    /**
     * 根据ID查询套餐
     * @param id
     * @return
     */
    @Override
    public Setmeal findById(Integer id) {
        Setmeal setmeal = setmealMobileDao.findById(id);

        return  setmeal;
    }
}
